Provide a ScheduledExecutorService to AsyncRequestQueue/AsyncNetwork.#367
Provide a ScheduledExecutorService to AsyncRequestQueue/AsyncNetwork.#367jpd236 merged 1 commit intogoogle:masterfrom
Conversation
d31a053 to
b94c989
Compare
This is a subset of google#363 which ensures a ScheduledExecutorService is available, but does not yet define a new RetryPolicy interface. This gives us the flexibility to introduce timer-based operations later without needing to change the ExecutorFactory interface (which is now an abstract class to allow for future additions, should any others be necessary).
b94c989 to
21e9f6c
Compare
| * providing them directly so that Volley can provide a PriorityQueue which will prioritize | ||
| * requests according to Request#getPriority. | ||
| */ | ||
| public interface ExecutorFactory { |
There was a problem hiding this comment.
Why not keeping the interface?
There was a problem hiding this comment.
This is taken from the Android API guidelines - since we can't use default interface methods in Volley, abstract classes are preferable because it gives us the flexibility to add methods in later versions. Since it seems like there's clearly value in such flexibility (as we're adding a scheduled Executor in this very PR), it seemed like a good time to make it an abstract class as well. I can't think of a concrete example of something we'd be likely to add here now that the scheduled executor is here, but I also don't see much benefit to keeping this an interface since I can't imagine anybody needs multiple inheritance to implement it.
This is a subset of #363 which ensures a ScheduledExecutorService is available,
but does not yet define a new RetryPolicy interface. This gives us the
flexibility to introduce timer-based operations later without needing to change
the ExecutorFactory interface (which is now an abstract class to allow for future
additions, should any others be necessary).